@echo off
echo Starting Fire Detection API Server...
echo 正在启动火灾检测API服务器...

cd /d "D:\code\DT_project_brandnew\FireDetection_backend"

echo Checking Python environment...
echo 检查Python环境...

python --version
if %errorlevel% neq 0 (
    echo Python is not installed or not in PATH!
    echo Python未安装或未添加到PATH环境变量！
    pause
    exit /b 1
)

echo Installing required packages...
echo 安装所需的Python包...

pip install flask flask-cors flask-socketio opencv-python pillow pygame requests

echo Starting Fire Detection API Server on port 5000...
echo 在端口5000启动火灾检测API服务器...
echo.
echo This service provides:
echo 此服务提供：
echo - Real-time fire detection / 实时火灾检测
echo - WebSocket support / WebSocket支持
echo - Audio alarm system / 音频警报系统
echo - Image upload detection / 图片上传检测
echo.
echo Make sure Ollama is running with gemma3:latest model
echo 请确保Ollama正在运行并已安装gemma3:latest模型
echo.

python fire_detection_api.py

pause
